package main

import (
	"Gin/middle/interceptor"
	"Gin/router"
	_ "Gin/utils/Mysql"
	_ "Gin/utils/Redis"
	"fmt"
	"github.com/gin-gonic/gin"
	"log"
)

func main() {
	gin.SetMode(gin.ReleaseMode)
	r := gin.Default()
	r.Use(interceptor.HttpInterceptor())
	path := []string{"/login", "/login1", "/getCaptcha", "/register",
		"/chat", "/cList", "/history", "/ser", "/sfm", "/gfm", "/add",
		"/unadd", "/gfl", "/ack"}
	interceptor.AddDischarged(path)
	router.CreateRootRouter(r)
	err := r.Run(":80")
	if err != nil {
		log.Println(fmt.Sprintf("服务器启动失败:%s", err.Error()))
	}
}
